unit uReportListForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, StdCtrls, Grids, DBGrids;

type
  TReportListForm = class(TForm)
    tbl1: TTable;
    btn1: TButton;
    btn2: TButton;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    procedure FormCreate(Sender: TObject);
    procedure btn1Click(Sender: TObject);
    procedure btn2Click(Sender: TObject);
  private
    { Private declarations }
    FReportFile: string;
  public
    { Public declarations }
    property ReportFile: string read FReportFile;
  end;

var
  ReportListForm: TReportListForm;

implementation

{$R *.dfm}

uses
  uGlobal;
  
procedure TReportListForm.FormCreate(Sender: TObject);
begin
  if FileExists(G_GLERPDB_File) then
  begin
    tbl1.Close;
    tbl1.TableName := G_GLERPDB_File;
    tbl1.Open;
  end;
end;

procedure TReportListForm.btn1Click(Sender: TObject);
begin
  if tbl1.RecordCount>0 then
  begin
    FReportFile := WorkPath + 'B' + tbl1.fieldByName('fcode').AsString;
    ModalResult := mrOk;
  end;
end;

procedure TReportListForm.btn2Click(Sender: TObject);
begin
  ModalResult := mrCancel;
end;

end.
